@echo off
setlocal enabledelayedexpansion

set "file=commands.txt"
set "total=0"
set "success=0"
set "failed=0"

for /f "delims=" %%a in (%file%) do (
    set /a "total+=1"
    echo Executing: %%a
    %%a
    if errorlevel 1 (
        echo Command failed: %%a
        set /a "failed+=1"
    ) else (
        echo Command succeeded: %%a
        set /a "success+=1"
    )
)

echo Total commands: !total! > batc_upload_res.txt
echo Successful commands: !success! >> batc_upload_res.txt
echo Failed commands: !failed! >> batc_upload_res.txt

